local mingwang = fk.CreateSkill{
  name = "lingling__mingwang",
}

Fk:loadTranslationTable{
  ["lingling__mingwang"] = "明王",
  [":lingling__mingwang"] = "你可以将<font color='red'>♥</font>牌当【桃】或火【杀】使用。",

  ["#lingling__mingwang"] = "明王：你可以将<font color='red'>♥</font>牌当【桃】或火【杀】使用",
}

mingwang:addEffect("viewas", {
  anim_type = "offensive",
  mute_card = false,
  prompt = "#lingling__mingwang",
  interaction = UI.CardNameBox {choices = {"peach", "fire__slash"}},
  handly_pile = true,
  card_filter = function(self, player, to_select, selected)
    return #selected == 0 and Fk:getCardById(to_select).suit == Card.Heart
  end,
  view_as = function(self, player, cards)
    if #cards ~= 1 or not self.interaction.data then return end
    local c = Fk:cloneCard(self.interaction.data)
    c.skillName = mingwang.name
    c:addSubcard(cards[1])
    return c
  end,
  enabled_at_response = function (self, player, response)
    return not response
  end,
})

mingwang:addAI(nil, "vs_skill")

return mingwang
